package com.designmodel.proxymodel.dynamicproxy.jdkdynamicproxy;

import com.designmodel.proxymodel.dynamicproxy.jdkdynamicproxy.button.CommitButton;
import com.designmodel.proxymodel.dynamicproxy.jdkdynamicproxy.button.IButton;
import com.designmodel.proxymodel.dynamicproxy.jdkdynamicproxy.window.IWindow;
import com.designmodel.proxymodel.dynamicproxy.jdkdynamicproxy.window.IdeaWindow;

/**
 * Created by
 * 测试类
 * @author touni
 * @date 2019/4/1
 * @time 13:04
 */
public class MainDemo {
    public static void main(String[] args) {
        IButton button = new CommitButton();
        DynamicProxy procy = new DynamicProxy(button);
        //创建代理对象
        IButton buttonProxy = (IButton) procy.createProxy();
        buttonProxy.click();
        buttonProxy.doubleClick();
        System.out.println("============================");
        IWindow window = new IdeaWindow();
        DynamicProxy proxy2 = new DynamicProxy(window);
        IWindow windowProxy = (IWindow) proxy2.createProxy();
        windowProxy.windowName();
        windowProxy.windowSize();


    }



}
